<template>
    <div>
        <div class="header">
            <div class="left">
                <slot name="left"></slot>
            </div>
            <div class="title2" v-if="center">{{title}}</div>
            <div class="title" v-else>{{title}}</div>
            <div class="right">
                <slot name="right"></slot>
            </div>
        </div>
    </div>
</template>

<script>
    export default {
        name: "publicheader",
        props: {
            title: {
                type: String
            },
            center: {
                type: Boolean,
                default: false
            }
        },
        data() {
            return {}
        }
    }
</script>

<style lang="scss" scoped>
    .header {
        padding: 0 5vw;
        display: flex;
        height: 60px;
        position: fixed;
        width: 90vw;
        line-height: 60px;
        background: #ffffff;
        z-index: 100;
        .title {
            padding-left: 15px;
        }
        .title2 {
            width: 200px;
            text-align: center;
            position: absolute;
            left: 50%;
            margin-left: -100px;
        }
        .left {
            justify-content: space-between;
        }
        .right {
            position: absolute;
            right: 20px;
        }
    }
</style>
